package com.leehom.arch.storage.exception;

/**
 * @类名: MessageEnum
 * @说明: 消息
 *
 * @author   leehom
 * @Date	 2020年12月3日 上午11:26:24
 * 修改记录：
 *
 * @see 	 
 */
public enum MessageCode {
	
	SUCCESS(0, "操作成功"),
	// common
	ERROR_STORAGE_FILENOTEXISTS(1001, "文件不存在, {0}"), // 0: 文件url
	ERROR_STORAGE_FILEEXISTSED(1002, "文件已存在, {0}"), // 0: 文件url
	ERROR_STORAGE_FILEECHECKFAILURE(1003, "文件检查错误，{0}"), // 0：文件url
	ERROR_STORAGE_FILEECHECKIO(1004, "文件检查IO错误，{0}"), // 0：文件url
	ERROR_STORAGE_UNKNOWNSCHEMA(1005, "未知schema，{0}"), // 0：schema
	// MinIO
	ERROR_STORAGE_MINIOSAVEFILE(1006, "MINIO保存文件错误，{0}, {1}, {2}"), // 0：bucket; 1: file name
	ERROR_STORAGE_MINIOGETFILE(1007, "MINIO获取文件错误，{0}, {1}, {2}"), // 0：bucket; 1: file name
	ERROR_STORAGE_MINIOLISTFILE(1009, "MINIO列表文件错误，{0}, {1}"), // 0：bucket;
	ERROR_STORAGE_MINIODELETEFILE(1010, "MINIO删除文件错误，{0}, {1}, {2}"), // 0：bucket; 1: file name
	ERROR_STORAGE_MINIOGETURL(1011, "MINIO获取流量url错误，{0}, {1}, {2}"), // 0：bucket; 1: file name
	// local
	ERROR_STORAGE_LOCALSAVEFILE(1012, "local保存文件错误，{0}, {1}, {2}"), // 0：path; 1: file name
	// ali oss
	
	//

	;

	public static final int FILESTORAGE_CODE_BASE= 0;
    private Integer code;
    private String msg;

    MessageCode(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }
    
    public String getCodeStr() {
        return code.toString();
    }

    public String getMsg() {
        return msg;
    }

}
